
$(function() {
	//点击显示
	$("#btn").click(function() {
//		$("#baom-sheji_wrapper").css("display", "block")
		console.log($(this))
		console.log($(this).context.dataset.ckname)
	})
	//叉叉关闭
	$("#baom_close").click(function() {
		$("#baom-sheji_wrapper").css("display", "none")	
	})
	//点击图片播放
	$(".baom_videoimg").click(function() {
		$(this).css("display", "none")
		var videoPlay = $('#baom_video')[0]
		videoPlay.play()
	})
	//单选按钮图片
    var  hometype="a",houseTime="a";
	
	radioimg = function() {
		for(let i = 0; i < $(".sheji_left_one").length; i++) {
			$(".sheji_left_one").eq(i).click(function() {
				let ind = $(this).index()
				$(this).find('.imgNoChecked').addClass('imgHide')
				$(this).siblings().find('.imgNoChecked').removeClass('imgHide')
				$(this).find('.imgChecked').removeClass('imgHide')
				$(this).siblings().find('.imgChecked').addClass('imgHide')
				hometype = $(".sheji_left_one").eq(ind).text()
//				console.log(house)	
			})
		}
	}
	radiostart = function() {
		for(let i = 0; i < $(".sheji_left_two").length; i++) {
			$(".sheji_left_two").eq(i).click(function() {
				let ind = $(this).index()
				$(this).find('.imgNoChecked').addClass('imgHide')
				$(this).siblings().find('.imgNoChecked').removeClass('imgHide')
				$(this).find('.imgChecked').removeClass('imgHide')
				$(this).siblings().find('.imgChecked').addClass('imgHide')
				houseTime = $(".sheji_left_two").eq(ind).text()
//				console.log(start)
			})
		}
	}
	
	radioimg()
	radiostart();
	var city = ['安徽', '北京', '重庆', '福建', '广西', '贵州', '广东', '甘肃', '海南', '湖北', '黑龙江', '河南', '河北', '湖南', '江苏', '吉林',
    '江西', '辽宁', '内蒙古', '宁夏', '澳门', '青海', '四川', '陕西', '上海', '山东', '山西', '台湾', '天津', '西藏', '香港', '新疆', '云南', '浙江'];
    for(var i=0;i<city.length;i++){
    	var op = document.createElement('OPTION');
		$(".baom_free_citylist").append(op);
		op.innerText = city[i];
		op.value = city[i];
    }
    $(".sheji_left_btn").click(function(){

    	
    	

		
    	console.log(hometype,houseTime)
//  	console.log($(".baom_free_citylist").val())
    })
   	
   	
   	function apply_people(){
		var suiji = Math.floor(Math.random()*(9999-4000+1)+4000);	
		suiji = suiji.toString();
		suiji = suiji.split("");
		$(".baom_free_apply span").each(function(i,n){
			$(".baom_free_apply span").eq(i).text(suiji[i]);
		})
	}
	apply_people()


    
})

	var $url=location.href,hreArray=$url.split("?")[1],semId="";
		$.ajax({
			type:"get",
			url:"http://semstat.17house.com/data/insertLogJsonp?callback=?",
			async:false,
			dataType: 'JSONP',
			data:{
				client:"H5",
				url:encodeURIComponent($url),
				hreArray:encodeURIComponent(hreArray),
				urlreferrer:(document.referrer || ''),
			},
			success:function(data){
				semId=data.id;
				console.log(semId);
			},
			error:function(){
				
			}
		});










//yuyueliangfangDesign.Close();
//yuyueliangfangDesign.Tan();

//  	$(".pop_up18").on("click", function () {
//          var wrapperhtml = '<div id="baom-sheji" class="baoming"> <!--左边--><div id="baom-freesheji_left"><!--<div class="baom_free_tit">免费获取设计方案</div>--><div class="baom_offer_tit">避免上当<span class="word_color">3秒估算装修报价</span></div><div class="baom_free_apply">已有&nbsp;&nbsp;<span>4</span>&nbsp;<span>2</span>&nbsp;<span>8</span>&nbsp;<span>1</span>&nbsp;&nbsp;人申请</div><!--城市--><!--<div class="baom_free_city"><img class="baom_free_cityimg" src="3/city.png"/><select class="baom_free_citylist"><option value="北京市">北京市</option></select></div>--><!--m面积--><div class="baom_free_area"><img class="baom_free_areaimg" src="img/area_03.png"/><input class="baom_free_areatext" type="text" name="" id="" value="" placeholder=""/><span class="baom_free_sqm">m²</span></div><!--手机号--><div class="baom_free_phone"><img class="baom_free_phoneimg" src="3/phone.png"/><input class="baom_free_phonetext" type="text" name="" id="" value="" placeholder="输入手机号，接收报价明细"/></div><div class="baom_free_btnbox"><button class="baom_free_btn">立即申请</button></div><div class="baom_free_fottext"><img src="3/dun.png"/> &nbsp;互联网装修上市企业 9年服务客户800万</div></div><!--右边--><div id="baom-budget_right"><h2>您的装修预算为 &nbsp;<span class="word_color">23246</span>&nbsp; 元</h2><div class="baom_budget_box"><ul><li>主材费：<span class="word_color">74568</span>元</li><li>施工费：<span class="word_color">44568</span>元</li><li>设计费：<span class="word_color">4568</span>元</li><li>施工费：<span class="word_color">1268</span>元</li></ul></div><p class="baom_budget_fottext"><span class="word_color">*报价有疑问？稍后装修管家将致电为您解答</span></p><p class="baom_budget_fottext">*该报价为整装全包价格，实际装修价格以量房实测为准</p></div><!--关闭--><div id="baom_close"><img src="img/close.png"/></div></div>'
//			$("#baom-sheji_wrapper").html(wrapperhtml)
//				
//			$("#baom-sheji_wrapper").css("display", "block");
//			yuyueliangfangDesign.close();
//      });